<template>
  <div class="beij">
    <div class="jinngpin banxin">
      <div class="title tanxin">
        <div class="title_l">
          <img :src="src" alt="" />
          <h2>{{ title }}</h2>
        </div>
        <div class="more" v-show="title !== '积分攻略'">
          <span>更多</span>
          <img src="../../assets/images/home/Arrow.png" alt="" />
        </div>
        <img src="" alt="" />
      </div>
      <ul class="li_style banxin tanxin">
        <li v-for="item in AllData" :key="item.id">
          <i>
            <img
              src="@/assets/images/home/hot-j.png"
              v-if="item.isHotSale === 1"
              alt=""
            />
            <img
              src="@/assets/images/home/new-j.png"
              v-if="item.isLatest === 1"
              alt=""
            />
          </i>
          <img :src="'http://sc.wolfcode.cn' + item.coverImg" alt="" />
          <p>{{ item.name }}</p>
          <span
            >{{ item.coin }}&nbsp;<img
              src="@/assets/images/home/monad.png"
              class="jit"
          /></span>
          <button>立即兑换</button>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: ["title", "src", "AllData"], //这里定义的数据，仅限于 父组件传给子组件的数据  父组件传来之后 必须 在这一个地方定义 才可以被使用 并且直接使用
};
</script>
 
<style lang = "less" scoped>
@import "../../assets/base.less";
.beij {
  background-color: #f5f5f5;
  margin-top: 20px;
}
.jinngpin {
  background-color: #f5f5f5;
}
.title {
  align-items: center;
  height: 106px;
  .title_l {
    display: flex;
    h2 {
      font-size: 30px;
      font-weight: bold;
      color: @black;
      margin-left: 10px;
    }
  }
  .more {
    transform: translateX(465px);
    span {
      font-size: 16px;
      color: #666666;
      line-height: 23px;
      margin-right: 10px;
    }
  }
}
.li_style {
  flex-wrap: wrap;
  justify-content: start;
  li {
    margin: 24px 5px;
    background-color: white;
    transition: all 0.2s ease-in;
    &:hover {
      transform: translateY(-20px);
    }
    &:hover button {
      color: white;
      background-color: #0a328e;
    }
    &:hover .jit {
      animation: run1 1s linear infinite;
    }
    text-align: center;
    font-size: 18px;
    position: relative;
    i {
      img {
        position: absolute;
        width: 58px;
        height: 58px;
      }
    }
    img {
      width: 285px;
      height: 250px;
    }
    p {
      color: #333;
      margin-top: 22px;
    }
    span {
      display: block;
      margin-top: 16px;
      color: #fd604d;
      img {
        width: 20px;
        height: 20px;
      }
      @keyframes run1 {
        0%,
        100% {
          transform: scale(1.5);
        }
        50% {
          transform: scale(0.5);
        }
      }
    }
    button {
      margin-top: 20px;
      width: 100px;
      height: 36px;
      border: 1px solid #0a328e;
      color: #0a328e;
    }
  }
}
</style>